/**
 * 
 */
package controller;

import java.util.Set;

import model.cnf.Stat;
import model.preprocessor.EPreProcessor;
import model.preprocessor.PreProcessorFactory;
import model.session.CNFUse;
import model.session.ExecutableSessionBlock;
import model.session.PreprocessorExecutionBlock;
import model.session.SolverExecutionBlock;
import model.solver.ESolver;
import model.solver.SolverFactory;
import vue.IIGSessionManager;
import controller.preprocessor.PreProcessor;
import controller.solver.Solver;

/**
 * Interface that provide the the operation needed to control a session.
 * 
 * @author GRONOWSKI Stephane svan001@aol.com
 * 
 *         igsat 2010
 * 
 */
public interface ISessionManager {

	/**
	 * Change the {@link IIGSessionManager} of the session manager.
	 * 
	 * @param manager
	 *            the new manager
	 */
	public void setIIGSessionManager(IIGSessionManager manager);

	/**
	 * Ask to check the {@link Stat} of the CNF.
	 * 
	 * @param cnf
	 *            the CNF
	 */
	public void checkCNFStat(CNFUse cnf);

	// execution
	/**
	 * Ask to execute a solver.
	 * 
	 * @param solver
	 *            the solver to execute
	 * @param cnf
	 *            the cnf to use
	 */
	public void executeSolver(Solver solver, CNFUse cnf);

	/**
	 * Ask to execute a preprocessor.
	 * 
	 * @param preproc
	 *            the preprocessor to execute
	 * @param cnf
	 *            the cnf to use
	 */
	public void executePreProcessor(PreProcessor preproc, CNFUse cnf);

	/**
	 * Return the {@link SolverFactory} of the controller.
	 * 
	 * @return the factory
	 */
	public SolverFactory getSolverFactory();

	/**
	 * Return the {@link PreProcessorFactory} of the controller.
	 * 
	 * @return the factory
	 */
	public PreProcessorFactory getPreProcessorFactory();

	/**
	 * Get all the type of preprocessor that can be lunch with this manager.
	 * 
	 * @return a set of {@link}EPreprocessor.
	 */
	public Set<EPreProcessor> getAvailablePreProcessor();

	/**
	 * Get all the type of solver that can be lunch with this manager.
	 * 
	 * @return a set of {@link]ESolver
	 */
	public Set<ESolver> getAvailableSolver();

	/**
	 * Remove the execution from the {@link CNFUse} : means that the application consider this
	 * operation and all operation that depend on this execution never append.
	 * 
	 * @param use
	 *            the cnf use that you want to modify
	 * @param exec
	 *            the execution to remove
	 */
	public void removeExecution(CNFUse use, PreprocessorExecutionBlock exec);

	/**
	 * Remove the execution from the {@link CNFUse} means that the application consider this
	 * operation and all operation that depend on this execution never append.
	 * 
	 * @param use
	 *            the cnf use that you want to modify
	 * @param exec
	 *            the execution to remove
	 */
	public void removeExecution(CNFUse use, SolverExecutionBlock exec);

	/**
	 * Remove the execution from the {@link CNFUse} : means that the application consider this
	 * operation and all operation that depend on this execution never append.
	 * 
	 * @param exec
	 *            the execution to remove
	 */
	public void removeExecution(PreprocessorExecutionBlock exec);

	/**
	 * Remove the execution from the {@link CNFUse} means that the application consider this
	 * operation and all operation that depend on this execution never append.
	 * 
	 * @param exec
	 *            the execution to remove
	 */
	public void removeExecution(SolverExecutionBlock exec);

	/**
	 * Close the session.
	 * 
	 * @return if everything was close correctly.
	 */
	public boolean close();

	/**
	 * Stop the execution from the {@link CNFUse}.
	 * 
	 * @param use
	 *            the cnf use that you want to stop
	 * @param exec
	 *            the execution to stop
	 */
	public void stopExecution(CNFUse use, ExecutableSessionBlock exec);

	/*
	 * return if this session contains tthis cnfuse
	 * 
	 * @param cnf the cnfuse
	 * 
	 * @return if this session contains tthis cnfuse public boolean containsCNFUse(CNFUse cnf);
	 */

}
